home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 5879 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.th-darmstadt.de!news
  2. From: Enno Sandner <enno@intellektik.informatik.th-darmstadt.de>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: delete
  5. Date: Wed, 07 Feb 1996 09:11:39 +0100
  6. Organization: Fachbereich Informatik, TH Darmstadt
  7. Message-ID: <31185EBB.41C67EA6@intellektik.informatik.th-darmstadt.de>
  8. References: <DMDBqB.Bw5@undergrad.math.uwaterloo.ca>
  9. NNTP-Posting-Host: kitz.intellektik.informatik.th-darmstadt.de
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6a (X11; I; SunOS 4.1.3 sun4m)
  14.  
  15. Steve Kettle wrote:
  16. > The delete operator can be overloaded in a class by overloading with
  17. > declaration
  18. >         void operator delete(void*);
  19. > There is no way I see to set a pointer being deleted to 0 because of the
  20. > pass by value.
  21. > Is there anyway to force a deleted pointer to be zero or are we just
  22. > at mercy of the compiler implementation?
  23. > --
  24.  
  25. I don't know of any compiler that zeros the pointer-value when the
  26. underlying object is deleted. Anyway unless you get completly rid of
  27. ordinary pointers and replace them by wrappers there is no reasonable
  28. way to mark an object as deleted. The remaining problem will always be
  29. objects that are referred by more then one pointer.
  30.  
  31.     Enno
  32.